<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
                xmlns:date="http://exslt.org/dates-and-times"
                extension-element-prefixes="date">

  <xsl:output method="xml"/>

  <xsl:template match="/">
    <xsl:apply-templates select="sessions"/>
  </xsl:template>

  <xsl:template match="sessions">
    <article>
      <articleinfo>
        <title>JavaOne 2008 Sessions</title>
        <releaseinfo>0.11</releaseinfo>
        <pubdate>April 2, 2008</pubdate>
      </articleinfo>
      <section>
        <title>Technical Sessions</title>
        <xsl:apply-templates select="session[type='TechnicalSession']"/>
      </section>
      <section>
        <title>Birds of a Feather</title>
        <xsl:apply-templates select="session[type='BirdsOfAFeather']"/>
      </section>
      <section>
        <title>Panel Session</title>
        <xsl:apply-templates select="session[type='PanelSession']"/>
      </section>
      <section>
        <title>Hands-on Lab</title>
        <xsl:apply-templates select="session[type='HandsOnLab']"/>
      </section>
    </article>
  </xsl:template>

  <xsl:template match="session">
    <section>
      <title><xsl:value-of select="id"/>: <xsl:value-of select="title"/></title>
      <para>
        <emphasis>
          <xsl:value-of select="date:day-name(schedule/start/text())"/>
          <xsl:text> </xsl:text>
          <xsl:value-of select="date:hour-in-day(schedule/start/text())"/>
          <xsl:text>:</xsl:text>
          <xsl:value-of select="date:minute-in-hour(schedule/start/text())"/>
          <xsl:text> - </xsl:text>
          <xsl:value-of select="date:hour-in-day(schedule/end/text())"/>
          <xsl:text>:</xsl:text>
          <xsl:value-of select="date:minute-in-hour(schedule/end/text())"/>
        </emphasis>
      </para>
      <xsl:apply-templates select="parts"/>
      <para>
        <emphasis>
          <xsl:text>Presenters: </xsl:text>
          <xsl:for-each select="presenters/presenter">
            <xsl:if test="position()!=1">
              <xsl:text>, </xsl:text>
            </xsl:if>
            <xsl:value-of select="name"/>
          </xsl:for-each>
        </emphasis>
      </para>
    </section>
  </xsl:template>

  <xsl:template match="parts/p">
    <para><xsl:apply-templates/></para>
  </xsl:template>

  <xsl:template match="parts/ul">
    <itemizedlist spacing="compact">
      <xsl:apply-templates/>
    </itemizedlist>
  </xsl:template>

  <xsl:template match="li">
    <listitem>
      <para><xsl:apply-templates/></para>
    </listitem>
  </xsl:template>

</xsl:stylesheet>